:root {
  --primary: #28a745;
  /* Green primary color */
  --primary-dark: #218838;
  /* Darker green */
  --accent: #20c997;
  /* Teal accent */
  --light: #f8f9fa;
  --dark: #212529;
  --success: #28a745;
  --error: #dc3545;
  --border-radius: 8px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}


.profile-page-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* === Modern Oracle-Like Profile Form Styling === */
.profile-title {
    position: absolute;
    top: 10px;
    left: 50px;
    font-size: 30px;
    
    /* Green theme version */
    color: #218838; /* Your darker green color */
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
    padding-bottom: 5px;
    border-bottom: 3px solid #28a745; /* Your primary green */
    display: inline-block;
    font-family: 'Poppins', sans-serif;
}

/* Wrap the form in a card-style container */
#profileFormContainer {
  background: #fff;
  padding: 30px;
/* padding-right: 20px; */
  border: 1px solid #ddd;
  border-radius: 0px;
  box-shadow: 0 10px 25px rgba(40, 167, 69, 0.1);
  /* max-width: 850px; */
  width: 90%;

  margin-top: 12%;
  margin-left: 25%;
  border-top: 4px solid var(--primary);
  /* position: relative; */
}

/* Edit / Close buttons aligned to top-right */
.action-buttons {
  position: absolute;
  top: 106px;
  right: 48%;
  display: flex;
  gap: 22px;
  z-index: 10;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  padding: 4px;
  border-radius: 8px;
}

.form-error-message {
  position: absolute;
  top: 20%;
  color: var(--error);
  font-size: 14px;
  text-align: center;
  width: 70%;
  font-weight: 500;
}

.btn-warning {
  background-color: var(--primary);
  color: white;
}

.btn-warning:hover {
  background-color: var(--primary-dark);
}


/* Profile fields layout: label and input side by side */
.profile-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 60px;
}

.form-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding-right: 30px;
  height: 55px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  /* flex: 0 0 140px; */
  width: 100px;
  font-size: 14px;
  color: #333;
  font-weight: 500;
  /* text-align: right; */
  margin-left: 20px;
}

/* Inputs styled like Oracle UI */
.form-input,
.form-input[readonly],
select.form-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  margin-right: 10px;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
  background: #fff;
  outline: none;
}

/* Optional hover for better feedback */
.form-input:hover:not([readonly]) {
  border-color: #999;
}

/* Buttons */
.btn {
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: background 0.3s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background-color:  var(--primary-dark);
}

.btn-secondary {
  border: 1px solid;
  border-radius: 5px;
  background-color: var(--primary);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--primary-dark);
}

/* Responsive (stack on smaller screens) */
/* @media (max-width: 768px) {
  .profile-form {
    grid-template-columns: 1fr;
  }

  .form-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-label {
    text-align: left;
  }

  .form-group.full-width {
    grid-column: span 1;
  }
} */

/* Phone input specific styling */
.iti {
  width: 100% !important;
  display: block;
}

.iti__selected-flag {
  padding: 0 16px 0 12px;
  border-radius: 12px 0 0 12px;
}

.iti__arrow {
  border-top-color: #666;
}

.iti__country-list {
  max-height: 200px;
  /* or adjust to fit your design */
  overflow-y: auto;
  z-index: 10000;
  /* ensures it appears above all */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Prevent width changes on typing */
.iti input {
  /* width: 91% !important; */
  box-sizing: border-box;
}

/* Optional: consistent height */
.iti .form-input {
  height: 48px;
}

/* Force tel input appearance like other fields */
.iti input.form-input {
  padding-left: 56px;
  /* leaves room for flag */
}

/* Make phone input + flag dropdown clean and aligned */
.phone-wrapper .iti {
  width: 100%;
}

.phone-wrapper input.form-input {
  padding-left: 52px !important;
  /* to avoid overlapping flag */
}

#fetchingMessage {
  text-align: center;
  padding: 20px;
}

.loading-spinner {
  border: 4px solid rgba(200, 230, 201, 0.8);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px auto;
}

.loading-text {
  color: var(--dark);
  font-size: 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Responsive */
/* @media (max-width: 768px) {
  .profile-form {
    grid-template-columns: 1fr;
  }

  .form-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-label {
    text-align: left;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  #profileFormContainer {
    margin-left: 10%;
    margin-right: 10%;
  }

  .avatar-container {
    position: static;
    margin: 20px auto;
  }
} */


.avatar-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0px;
  position: absolute;
  top: 35%;
  left: 60px;
}

.avatar-wrapper {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  overflow: hidden;
  cursor: pointer;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  margin-left: 20px;


}

.avatar-wrapper:hover {
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-actions {
  display: flex;
  gap: 12px;
  position: absolute;
  top: 110%;
  left: 0px;

}

.avatar-actions button {
  width: 120px;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #037f37;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.avatar-actions button:hover {
  background-color: #ea0606;
}






.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  /* dark overlay */
  backdrop-filter: blur(4px);
  /* optional blur */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.profile-success-message {
  background: #ffffff;
  padding: 30px 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
  max-width: 420px;
  border-top: 4px solid var(--primary);
}

.profile-success-message h3 {
  font-size: 20px;
  margin: 12px 0 8px;
  color: var(--primary);
}

.profile-success-message p {
  font-size: 14px;
  margin-bottom: 20px;
  color: #555;
}

.Update_logo {
  position: absolute;
  top: 20px;
  right: 20px;
}
.Update_logo img{
width: 150px;
}


@media (max-width: 1024px) {
  .profile-page-container {
    padding: 15px;
  }
  .form-label{
    width: 70px;

  }
  
  #profileFormContainer {
    margin-left: 20%;
    margin-top: 15%;
    width: 80%;
  }
  .avatar-actions{
    display: flow;
  }
  .avatar-actions button{
  margin-left: 45px;
  }
  .action-buttons {
    top: 100px;
    right: 37%;
  }
  
  .avatar-container {
    top: 30%;
    left: -10px;
  }
  
  .avatar-wrapper {
    width: 160px;
    height: 160px;
  }
  
  .profile-form {
    gap: 15px;
  }
  
  .form-group {
    height: 50px;
    padding-right: 70px;
    margin-right: -70px;
  }
  
  .Update_logo img {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .profile-page-container {
    flex-direction: column;
    align-items: center;
    padding: 10px;
  }
  
  #profileFormContainer {
    margin: 120px 5% 0;
    width: 90%;
    padding: 20px;
  }
  
  .profile-title {
    left: 30px;
    font-size: 24px;
  }
  
  .action-buttons {
    position: static;
    justify-content: center;
    margin: 20px auto;
    background: none;
    right: auto;
    top: auto;
    width: 100%;
  }
  
  .profile-form {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }
  
  .form-group {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    margin-bottom: 15px;
    padding-right: 0;
  }
  
  .form-label {
    text-align: left;
    width: 100%;
    margin-bottom: 5px;
  }
  
  .avatar-container {
    position: static;
    margin: 20px auto;
    order: -1;
  }
  
  .avatar-wrapper {
    width: 180px;
    height: 180px;
    margin-left: 0;
  }
  
  .avatar-actions {
    position: static;
    justify-content: center;
    margin-top: 15px;
    width: 100%;
  }
  
  .Update_logo {
    position: static;
    text-align: center;
    margin: 10px 0;
  }
  
  .Update_logo img {
    width: 150px;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }
}

.Goback{
      padding: 10px 15px;
      background-color:#28a745;
      color: white;
      font-size: 16px;
      border-radius: 4px;
      width: 140px;
      position: fixed;
      bottom: 10px;
      left: 10px;
      margin-left: 18px;
      border: none;
      cursor: pointer;
    }

    #phone{
      margin-left: 23px;
      padding: 8px 14px;
      padding-left: 100px important!;
      width: 91% !important;
      height: 38px;
    }
     .iti__flag-container{
      margin-left: 22px;
    }



/* Collapsible sections */
.collapsible-section {
  margin-top: 25px;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  padding: 15px 20px;
  background-color: #f8f9fa;
}

.collapsible-section summary {
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  color: var(--primary);
}

.collapsible-section[open] summary {
  margin-bottom: 15px;
}

.collapsible-section .form-group {
  margin-bottom: 10px;
}

#profileFormContainer details.collapsible-section {
  /* width: 100%; */
  margin-bottom: 20px;
  display: block;
}

#profileFormContainer {
  display: block !important;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 30px;
}
.required {
  color: red;
  font-weight: bold;
}
